#include "junix.h"
using namespace std;

void reverse(char * p) {
	char *beg = p;
	size_t len = strlen(p);
	char *end = p+len-1;
	char *mid  = p+len/2-1;
	char tmp;

	for (;beg<=mid;++beg,--end) {
		tmp = *beg;
		*beg = *end;
		*end = tmp;
	}
}

int main(int argc, char **argv)
{
	char p[] ="hello";
	reverse(p);
	cout<<p<<endl;
}
